package com.lanou.moving.activity;


import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageView;

import com.lanou.moving.R;
import com.lanou.moving.adapter.SearchContentAdapter;
import com.lanou.moving.base.BaseActivity;
import com.lanou.moving.base.BaseApplication;

/**
 * Created by dllo on 15/10/23.
 */
public class SearchContentActivity extends BaseActivity implements View.OnClickListener {
    private TabLayout mtabLayout;
    private ViewPager viewPager;
    private SearchContentAdapter adapter;
    private String url;
    private ImageView search_content_back;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search_content_activity);
        BaseApplication.getInstance().addActivity(this);
        mtabLayout = (TabLayout) findViewById(R.id.seekcontent_tablayout);
        viewPager = (ViewPager) findViewById(R.id.viewPager);
        search_content_back = (ImageView) findViewById(R.id.search_content_back);
        search_content_back.setOnClickListener(this);
        initData();
    }

    private void initData() {
        adapter = new SearchContentAdapter(getSupportFragmentManager());
        viewPager.setAdapter(adapter);
        mtabLayout.setupWithViewPager(viewPager);
        mtabLayout.setTabsFromPagerAdapter(adapter);

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.search_content_back:
                finish();
                break;
        }
    }
}
